﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace Unis.Framework.ORM.Model
{
    [DataContract]
    public class QueryParameterInfo
    {
        private List<QueryParameterInfo> _Childs;
        private DataFilterConditions _Condition;
        private string _DataTypeName;
        private string _Description;
        private QueryGroupLinkType _GroupNodeLinkType;
        private bool _IsGroupNode;
        private bool _Limited;
        private bool _MultiValue;
        private int _OrderIndex;
        private string _PropertyName;
        private object _Value;
        private object _Value2;

        public QueryParameterInfo()
        {
        }

        public QueryParameterInfo(QueryGroupLinkType groupNodeLinkType)
        {
            this._Childs = new List<QueryParameterInfo>();
            this._IsGroupNode = true;
            this._GroupNodeLinkType = groupNodeLinkType;
        }

        public QueryParameterInfo(string propertyName, object queryValue, DataFilterConditions filterCondition)
            : this(propertyName, queryValue, filterCondition, false)
        {
        }

        public QueryParameterInfo(string propertyName, object queryValue, DataFilterConditions filterCondition, bool limited)
        {
            this._PropertyName = propertyName;
            this._Value = queryValue;
            this._Condition = filterCondition;
            this._Limited = limited;
        }



        public List<QueryParameterInfo> Childs
        {
            get
            {
                return this._Childs;
            }
            set
            {
                this._Childs = value;
            }
        }


        public DataFilterConditions Condition
        {
            get
            {
                return this._Condition;
            }
            set
            {
                this._Condition = value;
            }
        }


        public string DataType
        {
            get
            {
                return this._DataTypeName;
            }
            set
            {
                this._DataTypeName = value;
            }
        }


        public string Description
        {
            get
            {
                return this._Description;
            }
            set
            {
                this._Description = value;
            }
        }


        public QueryGroupLinkType GroupNodeLinkType
        {
            get
            {
                return this._GroupNodeLinkType;
            }
            set
            {
                this._GroupNodeLinkType = value;
            }
        }


        public bool IsGroupNode
        {
            get
            {
                return this._IsGroupNode;
            }
            set
            {
                this._IsGroupNode = value;
            }
        }


        public bool Limited
        {
            get
            {
                return this._Limited;
            }
            set
            {
                this._Limited = value;
            }
        }


        public bool MultiValue
        {
            get
            {
                return this._MultiValue;
            }
            set
            {
                this._MultiValue = value;
            }
        }


        public int OrderIndex
        {
            get
            {
                return this._OrderIndex;
            }
            set
            {
                this._OrderIndex = value;
            }
        }


        public string PropertyName
        {
            get
            {
                return this._PropertyName;
            }
            set
            {
                this._PropertyName = value;
            }
        }


        public object Value
        {
            get
            {
                return this._Value;
            }
            set
            {
                this._Value = value;
            }
        }


        public object Value2
        {
            get
            {
                return this._Value2;
            }
            set
            {
                this._Value2 = value;
            }
        }
    }
}
